#pragma once
#include "simu_ec800.h"

/*========================================================================
 *  Marco Definition
 *========================================================================*/
#define QL_SIM_ERRCODE_BASE (QL_COMPONENT_SIM<<16)

#define QL_SIM_PIN_LEN_MAX  8          // Maximum length of PIN data. 

#define QL_PBK_ITEM_COUNT_MAX 20
#define QL_PBK_USERNAME_LEN_MAX 32
#define QL_PBK_PHONENUM_LEN_MAX 24

 /*========================================================================
  *  Enumeration Definition
  *========================================================================*/
  //SIM componant detail errcode, 4 bytes
typedef enum
{
    QL_SIM_SUCCESS = 0,
    QL_SIM_EXECUTE_ERR = 1 | QL_SIM_ERRCODE_BASE,
    QL_SIM_MEM_ADDR_NULL_ERR,
    QL_SIM_INVALID_PARAM_ERR,
    QL_SIM_NO_MEMORY_ERR,
    QL_SIM_SEMAPHORE_CREATE_ERR = 5 | QL_SIM_ERRCODE_BASE,
    QL_SIM_SEMAPHORE_TIMEOUT_ERR,
    QL_SIM_NOT_INSERTED_ERR,
    QL_SIM_CFW_IMSI_GET_REQUEST_ERR,
    QL_SIM_CFW_IMSI_GET_RSP_ERR,
    QL_SIM_CFW_ICCID_GET_REQUEST_ERR = 10 | QL_SIM_ERRCODE_BASE,
    QL_SIM_CFW_PHONE_NUM_GET_REQUEST_ERR,
    QL_SIM_CFW_PHONE_NUM_GET_RSP_NULL_ERR,
    QL_SIM_CFW_STATUS_GET_REQUEST_ERR,
    QL_SIM_CFW_PIN_ENABLE_REQUEST_ERR,
    QL_SIM_CFW_PIN_DISABLE_REQUEST_ERR = 15 | QL_SIM_ERRCODE_BASE,
    QL_SIM_CFW_PIN_VERIFY_REQUEST_ERR,
    QL_SIM_CFW_PIN_CHANGE_REQUEST_ERR,
    QL_SIM_CFW_PIN_UNBLOCK_REQUEST_ERR,
    QL_SIM_OPERATION_NOT_ALLOWED_ERR,
    QL_PBK_NOT_EXIT_ERR = 100 | QL_SIM_ERRCODE_BASE,
    QL_PBK_NOT_INIT_ERR,
    QL_PBK_ITEM_NOT_FOUND_ERR,
} ql_sim_errcode_e;

typedef enum
{
    QL_SIM_STATUS_READY = 0,
    QL_SIM_STATUS_PIN1_READY,
    QL_SIM_STATUS_SIMPIN,
    QL_SIM_STATUS_SIMPUK,
    QL_SIM_STATUS_PHONE_TO_SIMPIN,
    QL_SIM_STATUS_PHONE_TO_FIRST_SIMPIN = 5,
    QL_SIM_STATUS_PHONE_TO_FIRST_SIMPUK,
    QL_SIM_STATUS_SIMPIN2,
    QL_SIM_STATUS_SIMPUK2,
    QL_SIM_STATUS_NETWORKPIN,
    QL_SIM_STATUS_NETWORKPUK = 10,
    QL_SIM_STATUS_NETWORK_SUBSETPIN,
    QL_SIM_STATUS_NETWORK_SUBSETPUK,
    QL_SIM_STATUS_PROVIDERPIN,
    QL_SIM_STATUS_PROVIDERPUK,
    QL_SIM_STATUS_CORPORATEPIN = 15,
    QL_SIM_STATUS_CORPORATEPUK,
    QL_SIM_STATUS_NOSIM,
    QL_SIM_STATUS_PIN1BLOCK,
    QL_SIM_STATUS_PIN2BLOCK,
    QL_SIM_STATUS_PIN1_DISABLE = 20,
    QL_SIM_STATUS_SIM_PRESENT,
    QL_SIM_STATUS_UNKNOW,
}ql_sim_status_e;

